<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>蔬菜价格预测</title>
</head>

<body>
    <h1>蔬菜价格预测</h1>
    <form method="post">
        <label for="vegetable">选择蔬菜种类:</label>
        <select name="vegetable" id="vegetable">
            {% for vegetable in vegetable_types %}
            <option value="{{ vegetable }}">{{ vegetable }}</option>
            {% endfor %}
        </select><br><br>
        <label for="month">选择月份:</label>
        <input type="number" name="month" id="month" min="1" max="12" required><br><br>
        <label for="day">选择日期:</label>
        <input type="number" name="day" id="day" min="1" max="31" required><br><br>
        <input type="submit" value="预测">
    </form>
    {% if rf_prediction %}
    <h2>预测结果</h2>
    <p>你选择的蔬菜是 {{ vegetable }}，月份是 {{ month }}，日期是 {{ day }}。</p>
    <p>随机森林模型预测价格是: {{ rf_prediction }}</p>
    <p>梯度提升模型预测价格是: {{ gb_prediction }}</p>
    <p>支持向量机模型预测价格是: {{ svm_prediction }}</p>
    <p>多层感知机模型预测价格是: {{ mlp_prediction }}</p>
    {% endif %}
</body>

</html>